/**
 * api请求处理请求头
 * 对query的处理，方便接口使用
 */

module.exports = (req, res, next) => {
	if (req.path.indexOf('v1') > -1) {
		const query = req.query,
			page = +query.page || 1;
			page_size = +query.page_size || 10;

		query.limit = page_size;
		query.skip = (page - 1) * page_size;
		next();
	} else {
		next();
	}
}